package com.xcl.mapper;

import com.xcl.pojo.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper {

    //注册功能
    @Insert("insert into user (user_name,password,create_time) " +
            " values (#{userName},#{pwd},now())")
    public Integer register(@Param("userName") String userName,@Param("pwd") String pwd);


    //检查用户名是否已经存在

    @Select("select * from user where user_name = #{userName}")
    public User findUserByName(@Param("userName") String userName);

    //修改个人信息
    @Update("update user set user_name=#{userName} ,email = #{email} ,nick_name = #{nickName},update_time = now() where id = #{id}")
    public Integer updateUser(User user);
}
